// --- 
// Author : Alberto Franco
// File   : main.go
// Date   : 30-05-2011
// 
// This file contains the main program entry point
// --- 
package main

import (
	"fmt"
	"barbershop"
	"philosofer"
	"netsim"
	"picalculus"
)

func main() {
	var selection int32
	var end bool = false
	
	fmt.Println("Select program to run: ")
	fmt.Println("   [1] -> Dining Philosofers problem")
	fmt.Println("   [2] -> Barber Shop Probelm")
	fmt.Println("   [3] -> Simple network simulation")
	fmt.Println("   [4] -> Channel passing")
	fmt.Println("   [5] -> Function passing")
	
	for !end {
		fmt.Scanf("%d", &selection)
		
		switch(selection) {
			case 1:
				philosofer.Philosofer_Main()
				end = true
			case 2:
				barbershop.Barber_Main()
				end = true
			case 3:
				netsim.Netsim_Main()
				end = true
			case 4:
				picalculus.ChannelPassing_Main()
				end = true
			case 5:
				picalculus.FuncPassing_Main()
				end = true
			default:
				fmt.Println("Error, not recognized...Retry")				
		}				
	}	
}
